package cn.webrx;

import java.util.Date;

public class Date2 {
    public static void main(String[] args) {
        Date start = new Date();
        start.setYear(1985-1900);
        start.setMonth(12-1);
        start.setDate(18);

        //
        //start.setYear(2022-1900);
        //start.setMonth(7-1);
        //start.setDate(1);

        //System.out.printf("%tF %<tT",start);


        Date now = new Date();

        long days = (now.getTime()-start.getTime())/1000/60/60/24;
        System.out.println(days);

        //格式化输出
        System.out.printf("开始日期:%tF 到今天日期，共有%d天。",start,days);

    }
}
